/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sunspotworld;

/**
 *
 * @author me
 */
public class Producer extends Thread
            {

                int PTRIALS = 100;
                int PDELAY=1;   //ms

                BoundedBuffer bb;

                Producer(BoundedBuffer bb )
                {
                    this.bb = bb;
                }

                public void run()
                {
                    try
                    {
                        for (int i = 0; i < 100; i++)
                        {
                         System.out.println("Produce: " +i);
                          bb.put(i);
                          Thread.sleep(PDELAY);
                        }
                     } catch (InterruptedException e) {System.out.println("Producer Ex: ");}
                }
                }
